import request from "@/utiles/request";

//获取职位列表
export const getJobListAPI = (pageNo=1,pageSize=10)=>request.get(`job/getList?pageNo=${pageNo}&pageSize=${pageSize}`)
//添加或者修改职位
export const AddOrUpdateJobAPI = (data)=>{
    if(data._id) {
        return request.put(`/job/update?id=${data._id}`,data)
    }else {
        return request.post('/job/add',data)
    }
}
//获取职位详情
export const getJobDetailAPI = (id)=>request.get(`/job/getDetail?id=${id}`)
//给职位分配菜单权限
export const assignMenuAPI = (data)=>request.post('/job/addMenu',data)
//获取对应职位的菜单权限
export const getJobMenuAPI = (id)=>request.get(`/job/getMenu?jobId=${id}`)
//给职位分配按钮权限
export const assignButtonAPI = (data)=>request.post('/job/addButton',data)
//获取对应职位的按钮权限
export const getJobButtonAPI = (id)=>request.get(`/job/getButton?jobId=${id}`)
//删除职位
export const deleteAPI = (id)=>request.delete(`/job/delete?id=${id}`)